<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="__STATIC__/layout/favicon.ico">
    <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <style>
    </style>
</head>

<body style="color:#333;padding:3px;">
<div class="page-heade">
    <h2 class="title_color text-center">我的拜访签到轨迹</h2>
</div>
<!-- 标题 -->
<form action="" class="form-inline" method="get">
    <div class="row">
        <div class="col-xs-6">
            <table class="table-bordered table">
                <tr>
                    <td>
                        <span>日期：</span>
                        <a href="javascript:;" class="btn btn-sm btn-info" onclick="yesterday()">
                            <<前一天
                        </a>
                        <input type="text" name="date" id="today" value="" class="form-control"/>
                        <a href="javascript:;" class="btn btn-sm btn-success" onclick="tomorrow()">后一天>></a>
                        <span class="lr_5"></span>
                        <button class="btn-info btn-sm btn">查询</button>
                        <span class="lr_5"></span>
                        <button class="btn-danger btn-sm btn " type="button">清空</button>
                        <span class="lr_5"></span>
                    </td>
                </tr>
            </table>
            <div>
                <table class="tab-content table-bordered table-hover table bud_hei" border="1" style="margin-bottom:1px"
                       id="activeT" style="width: 60%">
                    <tr>
                        <td style="width: 15%">日期</td>
                        <td>2018-01-22</td>
                    </tr>
                    <tr>
                        <td>部门</td>
                        <td>{$de}</td>
                    </tr>
                    <tr>
                        <td>拜访签到人</td>
                        <td>{$em_name}</td>
                    </tr>
                    <tr>
                        <td>签到数量小计</td>
                        <td>0，今日总行程：0.00千米</td>
                    </tr>
                    <tr>
                        <td>失访数量小计</td>
                        <td>0</td>
                    </tr>
                </table>
                <table class="tab-content table-bordered table-hover table bud_hei" border="1" style="margin-bottom:1px"
                       id="activeT" style="width: 60%">
                    <tr class="info">
                        <td>签到类型</td>
                        <td>经销商</td>
                        <td>网点</td>
                        <td>签到汇报</td>
                        <td>市场活动</td>
                        <td>考勤</td>
                    </tr>
                    <tr>
                        <td class="info">数量</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                        <td>0</td>
                    </tr>
                </table>
                <table class="tab-content table-bordered text-center table-hover table bud_hei" border="1"
                       style="margin-bottom:1px" id="activeT" style="width: 60%">
                    <tr class="info">
                        <td>NO.</td>
                        <td>拜访类型</td>
                        <td>客户名</td>
                        <td>签到时间</td>
                        <td>签到地点</td>
                        <td>离上一站距离(千米)</td>
                    </tr>
                </table>
                <table class="tab-content table-bordered text-center table-hover table bud_hei" border="1"
                       style="margin-bottom:1px" id="activeT" style="width: 60%">
                    <tr class="info">
                        <td style="width: 4%">NO.</td>
                        <td style="width: 15%">失访网点</td>
                        <td>网点地址</td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="col-xs-6"></div>
    </div>


</form>

<!-- 全局js -->
<script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
<script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
<!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
<script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/layout/js/common.js"></script>
<script src="__STATIC__/layout/js/plugins/suggest/bootstrap-suggest.min.js"></script>

<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
<script src="__STATIC__/layout/js/contabs_sub.js"></script>
<script>
</script>

<script>
    $("#today").val(today(new Date()));

    function today(date) {
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        var d = date.getDate();
        return y + "-" + m + "-" + d;
    }

    function yesterday() {
        var val = $("#today").val();
        if (val) {
            var date = new Date(val);
            date -= 24 * 60 * 60 * 1000;
            $("#today").val(today(new Date(date)));
        }
    }

    function tomorrow() {
        var val = $("#today").val();
        if (val) {
            var date = new Date(val);
            date = date.getTime() + 24 * 60 * 60 * 1000;
            $("#today").val(today(new Date(date)));
        }
    }

    var area_id = $("#area_id");
    sousuo(area_id)

    function sousuo(id) {
        id.bsSuggest({
            allowNoKeyword: false, //是否允许无关键字时请求数据
            multiWord: true, //以分隔符号分割的多关键字支持
            separator: ",", //多关键字支持时的分隔符，默认为空格
            getDataMethod: "url", //获取数据的方式，总是从 URL 获取
            url: 'http://unionsug.baidu.com/su?p=3&t=' + (new Date()).getTime() + '&wd=',
            /*优先从url ajax 请求 json 帮助数据，注意最后一个参数为关键字请求参数*/
            jsonp: 'cb',
            /*如果从 url 获取数据，并且需要跨域，则该参数必须设置*/
            processData: function (json) { // url 获取数据时，对数据的处理，作为 getData 的回调函数
                var i, len, data = {
                    value: []
                };
                if (!json || !json.s || json.s.length === 0) {
                    return false;
                }

                // console.log(json);
                len = json.s.length;

                jsonStr = "{'value':[";
                for (i = 0; i < len; i++) {
                    data.value.push({
                        word: json.s[i]
                    });
                }
                data.defaults = 'baidu';

                //字符串转化为 js 对象
                return data;
            }
        });

    }

</script>
</body>

</html>
